package com.pan;

import com.pan.cuiniubi.driver.DaoDriver;
import com.pan.cuiniubi.driver.EntityDriver;
import com.pan.cuiniubi.driver.MappingDriver;
import com.pan.cuiniubi.entity.MappingInfo;
import com.pan.cuiniubi.entity.Table;
import com.pan.cuiniubi.read.ReadSql;

import java.io.IOException;
import java.util.List;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main(String[] args) {
        ReadSql readSql = new ReadSql();
        List<Table> listTable;
        try {
            listTable = readSql.getTable();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        new EntityDriver().outputEntity(listTable);

        DaoDriver daoDriver = new DaoDriver();
        daoDriver.outputSelectDao(listTable);
        daoDriver.outputDeleteDao(listTable);
        daoDriver.outputInsertDao(listTable);
        daoDriver.outputUpdateDao(listTable);

        MappingDriver mappingDriver = new MappingDriver();
        mappingDriver.outputSelectMapping(listTable);
        mappingDriver.outputUpdateMapping(listTable);
        mappingDriver.outputDeleteMapping(listTable);
        mappingDriver.outputInsertMapping(listTable);
    }
}
